package cn.iocoder.an.module.mold.dal.mysql.repairstatics;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.mold.dal.dataobject.repairstatics.RepairStaticsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.mold.controller.admin.repairstatics.vo.*;

/**
 * 维修统计 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RepairStaticsMapper extends BaseMapperX<RepairStaticsDO> {

    default PageResult<RepairStaticsDO> selectPage(RepairStaticsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RepairStaticsDO>()
                .eqIfPresent(RepairStaticsDO::getDrawingNoId, reqVO.getDrawingNoId())
                .eqIfPresent(RepairStaticsDO::getAccountId, reqVO.getAccountId())
                .eqIfPresent(RepairStaticsDO::getDepartId, reqVO.getDepartId())
                .eqIfPresent(RepairStaticsDO::getMoldCategoryId, reqVO.getMoldCategoryId())
                .eqIfPresent(RepairStaticsDO::getRepairCounts, reqVO.getRepairCounts())
                .eqIfPresent(RepairStaticsDO::getRepairManHours, reqVO.getRepairManHours())
                .eqIfPresent(RepairStaticsDO::getInnerRepairCounts, reqVO.getInnerRepairCounts())
                .eqIfPresent(RepairStaticsDO::getInnerRepairManHours, reqVO.getInnerRepairManHours())
                .eqIfPresent(RepairStaticsDO::getOuterRepairCounts, reqVO.getOuterRepairCounts())
                .eqIfPresent(RepairStaticsDO::getOuterRepairManHours, reqVO.getOuterRepairManHours())
                .betweenIfPresent(RepairStaticsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RepairStaticsDO::getId));
    }

}